package com.thrm.tiles;

import org.apache.tiles.Attribute;
import org.apache.tiles.AttributeContext;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.preparer.PreparerException;
import org.apache.tiles.preparer.ViewPreparerSupport;
import org.apache.tiles.request.Request;

//public class MyViewPreparer extends ViewPreparerSupport {
public class MyViewPreparer implements org.apache.tiles.preparer.ViewPreparer {

//	public void execute(Request tilesRequest, AttributeContext attributeContext) throws PreparerException {
//		attributeContext.putAttribute("menu", new Attribute("This is the value added by the MyViewPreparer"));
//	}

	@Override
	public void execute(TilesRequestContext tilesRequest, AttributeContext attributeContext) throws PreparerException {
//		attributeContext.putAttribute("menu", new Attribute("This is the value added by the MyViewPreparer"));
		Attribute attribute = new Attribute();
		attribute.setValue("/tiles/menu.jsp");
		attributeContext.putAttribute("menu", attribute);
	}
}